package com.example.chatty.logic.model

import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.toMutableStateList

class ConversationUiState(
    val initialMessages: List<Message>,
    val conversationUserId: String,
) {

    val array: Array<Message> = initialMessages.toTypedArray()

    val array2: MutableList<Message> = initialMessages.toMutableStateList()

    private val _messages: MutableList<Message> =
        mutableStateListOf(*array)
    val messages: List<Message> = _messages


    fun addMessage(message: Message) {
        _messages.add(0, message)
    }
}


